#include <fcntl.h>
#include <signal.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include <unistd.h>

#define MAXLINE 256

static void sig_alrm(int);

int main(){
    int n;
    char line[MAXLINE];
    if(signal(SIGALRM, sig_alrm) == SIG_ERR){
        printf("signal error:%s\n", strerror(errno));
        exit(0);
    }
    alarm(10);

    if((n = read(STDIN_FILENO, line, sizeof(line))) < 0){
        printf("read error:%s\n", strerror(errno));
        exit(0);
    }
    alarm(0);
    write(STDOUT_FILENO, line, sizeof(line));
    exit(0);
}

static void sig_alrm(int signo){

}